<template>
    <view class="box"> 盒子 </view>
    <view class="box"> 盒子 </view>
    <custom-form></custom-form>
</template>

<script setup>
import { onMounted } from "vue"

onMounted(() => {
    const selectQuery = uni.createSelectorQuery()
    selectQuery.select(".box").boundingClientRect((rect) => {
        console.log(
            "盒子的宽度为" + rect.width + "px",
            "盒子的高度为" + rect.height + "px"
        )
    })
    selectQuery.selectAll(".box").boundingClientRect((rect) => {
        console.log(rect)
    })
    selectQuery.selectViewport().scrollOffset((rect) => {
        console.log(rect)
    })
    selectQuery
        .selectViewport("")
        .boundingClientRect((rect) => {
            console.log(rect)
        })
        .exec()
})
</script>

<style>
.box {
    background-color: aquamarine;
    width: 200rpx;
    height: 200rpx;
}
</style>
